﻿@page "/kanban/header-template"
@inherits SampleBaseComponent;

@using ej2_blazor_kanban_data_models
@using Syncfusion.Blazor.Kanban

<SampleDescription>
    <p>This sample demonstrates the header template feature of Kanban. The column headers of Kanban are customized with text + icons in this demo.</p>
</SampleDescription>
<ActionDescription>
    <p>The Kanban provides an option to customize its column header using the <code>KanbanColumn</code> -> <code>Template</code> property.</p>
</ActionDescription>

<div class="col-lg-12 control-section">
    <SfKanban KeyField="Status" DataSource="@cardData">
        <KanbanColumns>
            @foreach (ColumnModel item in columnData)
            {
                <KanbanColumn HeaderText="@item.HeaderText" KeyField="@item.KeyField" AllowToggle="@item.AllowToggle">
                    <Template>
                        @{
                            KanbanColumn column = (KanbanColumn)context;
                            <div class="header-template-wrap">
                                <div class="header-icon e-icons @column.KeyField[0]"></div>
                                <div class="header-text">@column.HeaderText</div>
                            </div>
                        }
                    </Template>
                </KanbanColumn>
            }
        </KanbanColumns>
        <KanbanCardSettings ContentField="Summary" HeaderField="Id"></KanbanCardSettings>
    </SfKanban>
</div>

<style type="text/css">
    .e-kanban .header-template-wrap {
        display: inline-flex;
        font-size: 15px;
        font-weight: 400;
    }

        .e-kanban .header-template-wrap .header-icon {
            font-family: 'Kanban priority icons';
            margin-top: 3px;
            width: 10%;
        }

        .e-kanban .header-template-wrap .header-text {
            margin-left: 15px;
        }

    .e-kanban.e-rtl .header-template-wrap .header-text {
        margin-right: 15px;
    }

    .e-kanban .card-header {
        padding-left: 12px;
    }

    .e-kanban .Open::before {
        content: '\e700';
        color: #0251cc;
        font-size: 16px;
    }

    .e-kanban .InProgress::before {
        content: '\e703';
        color: #ea9713;
        font-size: 16px;
    }

    .e-kanban .Review::before {
        content: '\e701';
        color: #8e4399;
        font-size: 16px;
    }

    .e-kanban .Close::before {
        content: '\e702';
        color: #63ba3c;
        font-size: 16px;
    }

    @@font-face {
        font-family: 'Kanban priority icons';
        src: url(data:application/x-font-ttf;charset=utf-8;base64,AAEAAAAKAIAAAwAgT1MvMj1tSfUAAAE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IABpAGMAbwBuAHMARgBvAG4AdAAgAGcAZQBuAGUAcgBhAHQAZQBkACAAdQBzAGkAbgBnACAAUwB5AG4AYwBmAHUAcwBpAG8AbgAgAE0AZQB0AHIAbwAgAFMAdAB1AGQAaQBvAHcAdwB3AC4AcwB5AG4AYwBmAHUAcwBpAG8AbgAuAGMAbwBtAAAAAAIAAAAAAAAACgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQECAQMBBAEFAQYACFRvZG9saXN0BlJldmlldwlDb21wbGV0ZWQIUHJvZ3Jlc3MAAAAA) format('truetype');
        font-weight: normal;
        font-style: normal;
    }

    [class^="sf-icon-"],
    [class*=" sf-icon-"] {
        font-family: 'Kanban priority icons' !important;
        speak: none;
        font-size: 55px;
        font-style: normal;
        font-weight: normal;
        font-variant: normal;
        text-transform: none;
        line-height: 1;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
</style>

@code{
    private List<KanbanDataModel> cardData = new KanbanDataModel().GetTasks();
    private List<ColumnModel> columnData = new List<ColumnModel>() {
        new ColumnModel(){ HeaderText= "To Do", KeyField= new List<string>() { "Open" } },
        new ColumnModel(){ HeaderText= "In Progress", KeyField= new List<string>() { "InProgress"} },
        new ColumnModel() { HeaderText = "In Review", KeyField = new List<string>() { "Review"} },
        new ColumnModel(){ HeaderText= "Done", KeyField= new List<string>() { "Close"} }
    };
}